import { defineConfig } from 'tsup'

export default defineConfig({
    entry: ['src/bin/min.ts', 'src/index.ts',],
    tsconfig: 'tsconfig.json',
    outDir: 'lib',
    splitting: true,
    sourcemap: false,
    // dts: true,
    clean: true,
    treeshake: true,
    format: ['esm'],
    // cjsInterop: true,
    // when we need use require in ESM
    banner: {
        js: `import path_ from 'node:path';
        import { fileURLToPath } from 'node:url';
        const __filename = fileURLToPath(import.meta.url);
        const __dirname = path_.dirname(__filename);`
        // js: 'import { createRequire } from \'node:module\';const require = createRequire(import.meta.url);'
    },
    platform: "node"
})